package net.eearley.getco.app.base;

/**
 * The Class Key.
 */
public class Key {

	/**
	 * Gets the coords.
	 * 
	 * @return the coords
	 */
	public int[][] getCoords() {
		int coords[][] = { { xCoord, yCoord } };
		return coords;
	}

	/**
	 * Gets the x coord.
	 * 
	 * @return the x coord
	 */
	public int getXCoord() {
		return xCoord;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + xCoord;
		result = prime * result + yCoord;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Key other = (Key) obj;
		if (xCoord != other.xCoord)
			return false;
		if (yCoord != other.yCoord)
			return false;
		return true;
	}

	@Override
	public String toString() {
		return xCoord + ":" +  yCoord;
	}

	/**
	 * Sets the x coord.
	 * 
	 * @param coord
	 *            the new x coord
	 */
	public void setXCoord(int coord) {
		xCoord = coord;
	}

	/**
	 * Gets the y coord.
	 * 
	 * @return the y coord
	 */
	public int getYCoord() {
		return yCoord;
	}

	/**
	 * Sets the y coord.
	 * 
	 * @param coord
	 *            the new y coord
	 */
	public void setYCoord(int coord) {
		yCoord = coord;
	}

	/** The x coord. */
	private int xCoord;

	/** The y coord. */
	private int yCoord;

	/**
	 * Instantiates a new key.
	 * 
	 * @param x
	 *            the x
	 * @param y
	 *            the y
	 */
	public Key(int x, int y) {
		xCoord = x;
		yCoord = y;

	}

}
